<template>
  <view >
    <!-- 顶部滚动条 -->
    <uni-section>
      <uni-notice-bar show-icon scrollable
                      text="用心挑选每一种养老药品，为父母的健康筑起坚固的防线，让他们享受无忧无虑的金色年华。选择高品质的养老药品，不仅是为了父母的身体健康，更是为了他们心灵的安宁，让爱与关怀伴随每一个温馨的瞬间。"/>
    </uni-section>
    <!-- 老人信息表单 -->
    <uni-section title="老人基本信息" type="line">
      <view class="example">
        <!-- 基础用法，不包含校验规则 -->
        <uni-forms ref="baseForm" :modelValue="baseFormData">
          <uni-forms-item label="姓名" required>
            <uni-easyinput type="text" v-model="baseFormData.username"/>
          </uni-forms-item>
          <uni-forms-item label="身份证" required>
            <uni-easyinput type="text" v-model="baseFormData.num"/>
          </uni-forms-item>
          <uni-forms-item label="年龄" required>
            <uni-easyinput v-model="baseFormData.age"/>
          </uni-forms-item>
          <uni-forms-item label="性别" required>
            <uni-easyinput v-model="baseFormData.gender"/>
          </uni-forms-item>
          <uni-forms-item label="生日" required>
            <uni-easyinput type="text" v-model="baseFormData.birth"/>
          </uni-forms-item>
          <uni-forms-item label="健康状况" required>
            <uni-easyinput type="text" v-model="baseFormData.statys"/>
          </uni-forms-item>
          <uni-forms-item label="标签" required>
            <uni-easyinput type="text" v-model="baseFormData.tag"/>
          </uni-forms-item>
          <uni-forms-item label="备注" required>
            <uni-easyinput type="text" v-model="baseFormData.remark"/>
          </uni-forms-item>
        </uni-forms>
      </view>
    </uni-section>

  </view>

</template>
<script>
import axios from 'axios';

export default {
  data() {
    return {
      // 基础表单数据
      baseFormData: {
        username: '张三',
        birth: '1950-01-01 00:00:00',
        num: '12345678901234567890',
        age: '73',
        gender: '男',
        statys: '健康',
        tag: '高血压',
        remark: '无'
      },

    }
  },
  methods: {
    // async selectuserinfo() {
    //   try {
    //     // let user=localStorage.getItem("username")
    //     // user = JSON.parse(user)
    //     // this.baseFormData.username=user.username
    //     // let data=qs.stringify(baseFormData.value)
    //
    //     const response = await axios.get('http://localhost:8080/' + '/v1/user/select');
    //     this.baseFormData = response.data;
    //   } catch (error) {
    //     console.error('Error fetching user info:', error);
    //   }
    // }
  },
  // created() {
  //   this.selectuserinfo();
  // }

};

</script>

<style >

</style>
